	function showIcon(icon) {
		icon.getElementsByTagName("span")[4].style.display = "block";
		icon.getElementsByTagName("span")[5].style.display = "block";
	}
	function hideIcon(icon) {
		icon.getElementsByTagName("span")[4].style.display = "none";
		icon.getElementsByTagName("span")[5].style.display = "none";
	}
	function showEdit(id) {
		document.getElementById("opacity").style.display = "block";
		var editAd = document.getElementById("editAd");
		editAd.style.display = "block";
		var item = document.getElementById(id);
		var title = item.getElementsByTagName("span")[1].getElementsByTagName("a")[0].title;
		var href = item.getElementsByTagName("span")[2].getElementsByTagName("a")[0].title;
		
		var ad_title = document.getElementById("ad_title");
		ad_title.innerHTML = "<font style='font-weight: bold'>"+ title+"</font>";
		editAd.getElementsByTagName("textarea")[0].innerText = title;
		editAd.getElementsByTagName("input")[1].value = href;
		editAd.getElementsByTagName("input")[0].value = id;
	}
	
	function deleteAdById(id){
		var item = document.getElementById(id);
		if(confirm("确认删除？")){
			var form = document.createElement("form");
			form.action = "admin-deleteAdById.htm";
			form.method="post";
			form.innerHTML = "<input type='hidden' value='" + id + "' name='adId'/>"
			form.submit();
		} else {
			return
		}
	}
	function unlockScreen() {
		document.getElementById("editAd").style.display = "none";
		document.getElementById("addMultiAds").style.display = "none";
		document.getElementById("opacity").style.display = "none";
	}
	function showSearchAd() {
		var icon = document.getElementById("searchAD");
		document.getElementById("searchAD").style.display = (icon.style.display == "block") ? "none"
				: "block";
		document.getElementById("addAd").style.display = "none";
		if (icon.style.display == "block") {
			icon.getElementsByTagName("input")[0].focus();
		}
	}

	function showAddAd() {
		var icon = document.getElementById("addAd");
		document.getElementById("addAd").style.display = (icon.style.display == "block") ? "none"
				: "block";
		document.getElementById("searchAD").style.display = "none";
		if (icon.style.display == "block") {
			icon.getElementsByTagName("input")[0].focus();
		}
	}

	function addMultiAds() {
		document.getElementById("opacity").style.display = "block";
		var lockScreen = document.getElementById("addMultiAds").style.display = "block";
	}
	function addRow() {
		var li = document.createElement("li")
		li.innerHTML = "<table><tr><td style='width:170px'><textarea style='height:35px; width:150px;' name='adNames'>广告名</textarea></td><td><input type='text' name='adHrefs' value='http://' style='width:250px;'/></td></tr></table>";
		var ul = document.getElementById("ul1");
		var liList = ul.getElementsByTagName("li");
		if (liList.length <= 7) {
			ul.appendChild(li)
		}
	}
	
	function submitForm(page){
		var form = document.createElement("form");
		form.action="admin-searchAds.htm";
		form.method="post";
		var message = document.getElementById("message").title
		form.innerHTML = "<input type='hidden' name='keyword' value='" + message + "'/><input type='hidden' name='currentPage' value='" + page + "' />";
		form.submit();
	}